﻿<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<%@ include file="/common/meta.jsp"%>
<%@ include file="/common/content.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>友情链接信息管理</title>
<script>
$(document).ready(function(){

		$("#name").focus();
		$("#linksForm").validate({
			 rules: { 
				name: { 
        			required: true, 
        			maxlength:10,
        			remote: "rolesAction!checkName.action?orgName=${roles.name}&math="+Math.random()
    			}
			},
			messages: {
				name: {
					remote: "该角色已存在"
				}
			},
			success: function(label) {
				label.html("&nbsp;").addClass("checked");
	        }	
		});
	});	
</script>	
	</head>
	<body>
 	 <table class="listTable2">
			<tr>
				<td width="20px">
					<img src="${ctx}/image/jwc/tb.gif" width="16" height="16" />
				</td>
				<td width="90%">
					<span class="color:#000">当前位置</span>：[用户管理 - 角色管理 - 编辑角色信息]
				</td>
				<td>
					<input type="button" value="返回" onclick="history.back()"/>
				</td>
			</tr>
		</table>
		<form action="rolesAction!update.action" method="post" id="linksForm" enctype="multipart/form-data" method="post">
			<input type="hidden" name="roles.id" value="${roles.id}"/>
		<table  align="center" class="listTable3" width="90%">
			<tr>
				<td>角色名称</td>
				<td>
					<input type="text" name="roles.name" value="${roles.name}"/>
				</td>
			</tr>
			<tr>
			<td>授权</td>
			<td>
				<ul style="list-style-type:none;">
				
					<c:forEach var="ep" items="${authoritiesList}">
					
						<li><input  type="checkbox" name="checkedMenu" value="${ep.id}"
							
							<c:forEach var="authorities" items="${roles.rolesAuthoritieses}">
								<c:if test="${ep.id==authorities.authorities.id}">
									checked
								</c:if>
							</c:forEach>
						/>${ep.displayName}
						</li>
						
					</c:forEach>
					
				</ul>
			</td>
			</tr>
			<tr>
				<td>
					状态
				</td>
				<td>
					<select name="roles.state">
						<option value="1">已启用</option>
						<option value="0" <c:if test="${roles.state == 0}">selected</c:if>>
							已停用
						</option>
					</select>
				</td>
			</tr>
			<tr>
				<td colspan="2" align="center">
				<input type="submit" value=" 提 交 "/>
				<input type="button" value=" 返 回 " onclick="history.back()"/>
				</td>
			</tr>
	 	</table>
	</form>
	</body>
</html>

